<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/reset.css">
    <style>
        .nav {
            overflow: hidden;
        }

        .nav li {
            background-color: #ff0;
            float: left;
            width: 80px;
            text-align: center;
            line-height: 40px;
            position: relative;
            transition: .3s;
        }

        .nav li a {
            display: block;
        }

        .nav li:after {
            /* content:"内容"   content:url()    content:attr(属性)   attribute */
            content: attr(data);
            width: 80px;

            position: absolute;
            left: 0;

            transition: 1s;
        }

        .nav li:hover {
            transform: translateY(-40px);
        }
    </style>
</head>

<body>

    <ul class="nav clearfix">
        <li data="首页">
            <a href="">首页</a>

        </li>
        <li data="作品">
            <a href="">作品</a>
        </li>
        <li data="关于">
            <a href="">关于</a>
        </li>
        <li data="推广">
            <a href="">推广</a>
        </li>
    </ul>

</body>

</html>